package justtry;

/**
 * Created by weishaofei on 2017/12/6.
 */
public class JustSingleton {

    private static volatile JustSingleton singleton = null;

    private JustSingleton(){

    }

    public static JustSingleton getInstant(){
        if (singleton == null){
            synchronized (JustSingleton.class){
                if (singleton == null){
                    singleton = new JustSingleton();
                }
            }
        }
        return singleton;
    }

    public static void main(String[] args) {
        Integer i = 100;
    }
}
